<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Python基础知识点(爬虫基础简介) | 小何blog (记录美好)</title><meta name="keywords" content="Python,基础知识✍️"><meta name="author" content="六根清静"><meta name="copyright" content="六根清静"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="Python是一门解释型，面向对象的高级编程语言。是一门开源免费的，支持交互式，可跨平台移植的脚本语言。">
<meta property="og:type" content="article">
<meta property="og:title" content="Python基础知识点(爬虫基础简介)">
<meta property="og:url" content="https://liugenqingjing2.coding.me/2020/12/02/Python%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%82%B9-%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80%E7%AE%80%E4%BB%8B/index.html">
<meta property="og:site_name" content="小何blog (记录美好)">
<meta property="og:description" content="Python是一门解释型，面向对象的高级编程语言。是一门开源免费的，支持交互式，可跨平台移植的脚本语言。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201202/5vjB9ckhmw@0.jpg">
<meta property="article:published_time" content="2020-12-02T03:24:34.000Z">
<meta property="article:modified_time" content="2021-01-10T12:27:10.676Z">
<meta property="article:author" content="六根清静">
<meta property="article:tag" content="Python">
<meta property="article:tag" content="基础知识✍️">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201202/5vjB9ckhmw@0.jpg"><link rel="shortcut icon" href="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20200907/wOu*ZmuVb5A4.png"><link rel="canonical" href="https://liugenqingjing2.coding.me/2020/12/02/Python%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%82%B9-%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80%E7%AE%80%E4%BB%8B/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin="crossorigin"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?e829919a4d931d733ee74d5d97a51582";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;display=swap"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":20,"languages":{"author":"作者: 六根清静","link":"链接: ","source":"来源: 小何blog (记录美好)","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  ClickShowText: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: true,
  islazyload: true,
  isanchor: true
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-01-10 20:27:10'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = '2'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}})()</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/HCLonely/images@master/others/heartbeat.min.css"><link rel="stylesheet" href="/css/shuo.css"/><link rel="stylesheet" href="/magnetcss/magnet.css"/><link rel="stylesheet" href="/css/calendar.css"/><link rel="stylesheet" href="//at.alicdn.com/t/font_2060620_l0j6b710zk.css"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/css/font-awesome-animation.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/css/macblack.css"><link rel="stylesheet" href="/css/change.css"><link rel="stylesheet" href="/news/css/news.css"/><style type="text/css">#toggle-sidebar {bottom: 80px}</style><link rel="stylesheet" href="/magnet/css/catalogMagnet.css"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-double-row-display@1.00/cardlistpost.css"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/css/iconfont.min.css"><link rel="stykesheet" href="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/css/pool.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"/><link rel="stylesheet" href="/zan/zan.css"><link rel="stylesheet" href="/swiper/swiper.min.css"><link rel="stylesheet" href="/swiper/swiperstyle.css"><style>#article-container.post-content h1:before, h2:before, h3:before, h4:before, h5:before, h6:before { -webkit-animation: avatar_turn_around 1s linear infinite; -moz-animation: avatar_turn_around 1s linear infinite; -o-animation: avatar_turn_around 1s linear infinite; -ms-animation: avatar_turn_around 1s linear infinite; animation: avatar_turn_around 1s linear infinite; }</style><meta name="generator" content="Hexo 5.0.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="wizard-scene"><div class="wizard-objects"><div class="wizard-square"></div><div class="wizard-circle"></div><div class="wizard-triangle"></div></div><div class="wizard"><div class="wizard-body"></div><div class="wizard-right-arm"><div class="wizard-right-hand"></div></div><div class="wizard-left-arm"><div class="wizard-left-hand"></div></div><div class="wizard-head"><div class="wizard-beard"></div><div class="wizard-face"><div class="wizard-adds"></div></div><div class="wizard-hat"><div class="wizard-hat-of-the-hat"></div><div class="wizard-four-point-star --first"></div><div class="wizard-four-point-star --second"></div><div class="wizard-four-point-star --third"></div></div></div></div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" data-lazy-src="http://01.027cgb.com/632500/1576904533264.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">138</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">63</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/stars/"><i class="fa-fw fas fa-star faa-shake animated-hover"></i><span> 收藏网址</span></a></div><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw iconfont icon-zhuye faa-shake animated-hover"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/blog.html"><i class="fa-fw iconfont icon-Artboard faa-shake animated-hover"></i><span> 博客</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw iconfont icon-guidang faa-shake animated-hover"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw iconfont icon-biaoqian faa-shake animated-hover"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-yule1"></i><span> 娱乐</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/movies/"><i class="fa-fw iconfont icon-yingshi faa-shake animated-hover"></i><span> 影视</span></a></li><li><a class="site-page" href="/games/"><i class="fa-fw iconfont icon-youxi1 faa-shake animated-hover"></i><span> 游戏</span></a></li><li><a class="site-page" href="/galleryGroup"><i class="fa-fw iconfont icon-tuku faa-shake animated-hover"></i><span> 图库</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/messagepad/"><i class="fa-fw iconfont icon-ziyuan6 faa-shake animated-hover"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw iconfont icon-icon_xinyong_xianxing_jijin- faa-shake animated-hover"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw iconfont icon-guanyuwomen faa-shake animated-hover"></i><span> 关于我</span></a></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201202/5vjB9ckhmw@0.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">小何blog (记录美好)</a></span><span id="menus"><div id="search_button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/stars/"><i class="fa-fw fas fa-star faa-shake animated-hover"></i><span> 收藏网址</span></a></div><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw iconfont icon-zhuye faa-shake animated-hover"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/blog.html"><i class="fa-fw iconfont icon-Artboard faa-shake animated-hover"></i><span> 博客</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw iconfont icon-guidang faa-shake animated-hover"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw iconfont icon-biaoqian faa-shake animated-hover"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-yule1"></i><span> 娱乐</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/movies/"><i class="fa-fw iconfont icon-yingshi faa-shake animated-hover"></i><span> 影视</span></a></li><li><a class="site-page" href="/games/"><i class="fa-fw iconfont icon-youxi1 faa-shake animated-hover"></i><span> 游戏</span></a></li><li><a class="site-page" href="/galleryGroup"><i class="fa-fw iconfont icon-tuku faa-shake animated-hover"></i><span> 图库</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/messagepad/"><i class="fa-fw iconfont icon-ziyuan6 faa-shake animated-hover"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw iconfont icon-icon_xinyong_xianxing_jijin- faa-shake animated-hover"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw iconfont icon-guanyuwomen faa-shake animated-hover"></i><span> 关于我</span></a></div></div><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="post-info"><h1 class="post-title">Python基础知识点(爬虫基础简介)</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-12-02T03:24:34.000Z" title="发表于 2020-12-02 11:24:34">2020-12-02</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-01-10T12:27:10.676Z" title="更新于 2021-01-10 20:27:10">2021-01-10</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%90%8E%E7%AB%AF%E5%AD%A6%E4%B9%A0/">后端学习</a></span></div><div class="meta-secondline"> <span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">4.4k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>12分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="Python基础知识点-爬虫基础简介-："><a href="#Python基础知识点-爬虫基础简介-：" class="headerlink" title="Python基础知识点(爬虫基础简介)："></a>Python基础知识点(爬虫基础简介)：</h1><blockquote>
<p><a target="_blank" rel="noopener" href="https://book.apeland.cn/details/12/">路飞学城Pythone文档</a></p>
</blockquote>
<ul>
<li><h2 id="什么是爬虫？"><a href="#什么是爬虫？" class="headerlink" title="什么是爬虫？"></a>什么是爬虫？</h2><blockquote>
<p>- 形象概念： 爬虫，即网络爬虫，大家可以理解为在网络上爬行的一直蜘蛛，互联网就比作一张大网，而爬虫便是在这张网上爬来爬去的蜘蛛咯，如果它遇到资源，那么它就会抓取下来。想抓取什么？这个由你来控制它。</p>
<p>- 学术概念：爬虫就是通过编写程序<strong>模拟</strong>浏览器上网，让其去互联网上<strong>抓取</strong>数据的过程。</p>
</blockquote>
<hr>
</li>
<li><h2 id="爬虫的价值："><a href="#爬虫的价值：" class="headerlink" title="爬虫的价值："></a>爬虫的价值：</h2><ul>
<li><p>为什么要学习爬虫，学习爬虫能够为我们以后的发展带来那些好处？其实学习爬虫的原因和为我们以后发展带来的好处都是显而易见的，无论是从实际的应用还是从就业上。</p>
</li>
<li><p>抓取互联网上的数据，为我所用，有了大量的数据，就如同有了一个数据银行一样，下一步做的就是如何将这些爬取的数据产品化，商业化。</p>
<p><img src= "/img/loading.gif" data-lazy-src="https://img2018.cnblogs.com/blog/1397259/201811/1397259-20181113154859574-2018265702.png" alt="img"></p>
</li>
</ul>
</li>
</ul>
<ul>
<li>从就业的角度来说，爬虫工程师目前来说属于紧缺人才，并且薪资待遇普遍较高所以，深层次地掌握这门技术，对于就业来说，是非常有利的。有些人学习爬虫可能为了就业或者跳槽。从这个角度来说，爬虫工程师是不错的选择之一。随着大数据时代的来临，爬虫技术的应用将越来越广泛，在未来会拥有更好的发展空间。</li>
</ul>
<hr>
<ul>
<li><h2 id="爬虫究竟是合法还是违法的？"><a href="#爬虫究竟是合法还是违法的？" class="headerlink" title="爬虫究竟是合法还是违法的？"></a>爬虫究竟是合法还是违法的？</h2><ul>
<li><p>这个问题确实有些让程序猿毛骨悚然，只是简单的写了几行爬虫代码而已，却莫名其妙的进了局子，不知道还以为我们程序员是做军火生意的。接下来我们就来探讨下，你写的爬虫程序确定不违法吗？</p>
<p><img src= "/img/loading.gif" data-lazy-src="https://book.apeland.cn/media/images/2019/04/11/snip20190411_13.png"></p>
</li>
<li><p><strong>正解在此:</strong></p>
<ul>
<li>爬虫作为一种计算机技术就决定了它的<strong>中立性</strong>，因此爬虫本身<strong>在法律上并不被禁止</strong>，但是利用爬虫技术获取数据这一行为是具有违法甚至是犯罪的风险的。所谓具体问题具体分析，正如水果刀本身在法律上并不被禁止使用，但是用来捅人，就不被法律所容忍了。</li>
<li>或者我们可以这么理解：爬虫是用来批量获得网页上的公开信息的，也就是前端显示的数据信息。因此，既然本身就是公开信息，其实就像浏览器一样，浏览器解析并显示了页面内容，爬虫也是一样，只不过爬虫会批量下载而已，<strong>所以是合法的</strong>。不合法的情况就是配合爬虫，利用黑客技术攻击网站后台，窃取后台数据（比如用户数据等）。</li>
<li>举个例子：像谷歌这样的搜索引擎爬虫，每隔几天对全网的网页扫一遍，供大家查阅，各个被扫的网站大都很开心。这种就被定义为“善意爬虫”。但是像抢票软件这样的爬虫，对着 12306 每秒钟恨不得撸几万次，铁总并不觉得很开心，这种就被定义为“恶意爬虫”。</li>
</ul>
<hr>
</li>
<li><h2 id="爬虫所带来风险主要体现在以下2个方面："><a href="#爬虫所带来风险主要体现在以下2个方面：" class="headerlink" title="爬虫所带来风险主要体现在以下2个方面："></a>爬虫所带来风险主要体现在以下2个方面：</h2><ul>
<li>爬虫干扰了被访问网站的正常运营；</li>
<li>爬虫抓取了受到法律保护的特定类型的数据或信息。</li>
</ul>
<hr>
</li>
<li><h2 id="那么作为爬虫开发者，如何在使用爬虫时避免进局子的厄运呢？"><a href="#那么作为爬虫开发者，如何在使用爬虫时避免进局子的厄运呢？" class="headerlink" title="那么作为爬虫开发者，如何在使用爬虫时避免进局子的厄运呢？"></a>那么作为爬虫开发者，如何在使用爬虫时避免进局子的厄运呢？</h2><ul>
<li>严格遵守网站设置的<strong>robots协议</strong>；</li>
<li>在规避反爬虫措施的同时，需要优化自己的代码，避免干扰被访问网站的正常运行；</li>
<li>在使用、传播抓取到的信息时，应审查所抓取的内容，如发现属于用户的个人信息、隐私或者他人的商业秘密的，应及时停止并删除。</li>
</ul>
<hr>
</li>
<li><p>可以说在我们身边的网络上已经密密麻麻爬满了各种网络爬虫，它们善恶不同，各怀心思。而越是每个人切身利益所在的地方，就越是爬满了爬虫。<strong>所以爬虫是趋利的，它们永远会向有利益的地方爬行。</strong>技术本身是无罪的，问题往往出在人无限的欲望上。因此爬虫开发者的道德自持和企业经营者的良知才是避免触碰法律底线的根本所在。</p>
</li>
</ul>
<hr>
</li>
<li><h1 id="爬虫初识深入"><a href="#爬虫初识深入" class="headerlink" title="爬虫初识深入:"></a>爬虫初识深入:</h1><ul>
<li><h2 id="哪些语言可以实现爬虫："><a href="#哪些语言可以实现爬虫：" class="headerlink" title="哪些语言可以实现爬虫："></a>哪些语言可以实现爬虫：</h2><ul>
<li>**<code>php</code>**：可以实现爬虫。<code>php</code>被号称是全世界最优美的语言（当然是其自己号称的，就是王婆卖瓜的意思），但是<code>php</code>在实现爬虫中支持多线程和多进程方面做的不好。</li>
<li>**<code>c、c++</code>**：可以实现爬虫。但是使用这种方式实现爬虫纯粹是是某些人（大佬们）能力的体现，却不是明智和合理的选择。</li>
<li>**<code>java</code>**：可以实现爬虫。<code>java</code>可以非常好的处理和实现爬虫，是唯一可以与<code>python</code>并驾齐驱且是<code>python</code>的头号劲敌。但是<code>java</code>实现爬虫代码较为臃肿，重构成本较大。</li>
<li>**<code>python</code>**：可以实现爬虫。<code>python</code>实现和处理爬虫语法简单，代码优美，支持的模块繁多，学习成本低，具有非常强大的框架且一语难以言表的好！没有但是！</li>
</ul>
<hr>
</li>
<li><h2 id="爬虫的分类"><a href="#爬虫的分类" class="headerlink" title="爬虫的分类:"></a>爬虫的分类:</h2><ul>
<li><strong>通用爬虫：</strong>通用爬虫是搜索引擎（Baidu、Google、Yahoo等）“抓取系统”的重要组成部分。主要目的是将互联网上的网页下载到本地，形成一个互联网内容的镜像备份。 简单来讲就是尽可能的；把互联网上的所有的网页下载下来，放到本地服务器里形成备分，在对这些网页做相关处理(提取关键字、去掉广告)，最后提供一个用户检索接口。</li>
<li><strong>聚焦爬虫：</strong>聚焦爬虫是根据指定的需求抓取网络上指定的数据。例如：获取豆瓣上电影的名称和影评，而不是获取整张页面中所有的数据值。</li>
<li><strong>增量式爬虫：</strong>增量式是用来检测网站数据更新的情况，且可以将网站更新的数据进行爬取（后期会有章节单独对其展开详细的讲解）。</li>
</ul>
<hr>
</li>
<li><h2 id="爬虫的矛与盾"><a href="#爬虫的矛与盾" class="headerlink" title="爬虫的矛与盾:"></a>爬虫的矛与盾:</h2><ul>
<li><p>有一个说法是，互联网上50%的流量都是爬虫创造的。这个说法虽然夸张了点，但也体现出了爬虫的无处不在。爬虫之所以无处不在，是因为爬虫可以为互联网企业带来收益。</p>
</li>
<li><p>对于相关的电商网站来说，很多电商网站是愿意被比价网站或者其他购物信息网站爬取信息的，因为这样能够给他们的商品带来更多流量。但他们不愿意被其他电商网站获取价格信息和商品描述，因为担心其他电商网站恶意比价或进行抄袭。同时他们又经常去爬其他电商网站的数据，希望能够看到别人的价格。</p>
<p><img src= "/img/loading.gif" data-lazy-src="https://book.apeland.cn/media/images/2019/04/11/snip20190411_14.png" alt="img"></p>
</li>
<li><p>这种纠结又复杂的心情就像学霸间的竞争，学霸可以给学渣抄笔记，因为知道学渣再怎么努力也就是六七十分的水平，但学霸对其他学霸一定会严防死守，因为只有学霸和学霸之间才有真正的竞争。那么这种矛盾如何被解决呢？</p>
</li>
</ul>
<hr>
</li>
<li><h2 id="反爬机制："><a href="#反爬机制：" class="headerlink" title="反爬机制："></a>反爬机制：</h2><ul>
<li><strong>门户网站</strong>通过制定相应的策略和技术手段，防止爬虫程序进行网站数据的爬取。</li>
</ul>
<hr>
</li>
<li><h2 id="反反爬策略："><a href="#反反爬策略：" class="headerlink" title="反反爬策略："></a>反反爬策略：</h2><ul>
<li>爬虫程序通过相应的策略和技术手段，破解门户网站的反爬虫手段，从而爬取到相应的数据。、</li>
</ul>
<hr>
</li>
<li><h2 id="robots协议："><a href="#robots协议：" class="headerlink" title="robots协议："></a><code>robots</code>协议：</h2><ul>
<li>几乎是和爬虫技术诞生的同一时刻，反爬虫技术也诞生了。在90年代开始有搜索引擎网站利用爬虫技术抓取网站时，一些搜索引擎从业者和网站站长通过邮件讨论定下了一项“君子协议”—— robots.txt。即网站有权规定网站中哪些内容可以被爬虫抓取，哪些内容不可以被爬虫抓取。这样既可以保护隐私和敏感信息，又可以被搜索引擎收录、增加流量。</li>
<li>历史上第一桩关于爬虫的官司诞生在2000年，eBay将一家聚合价格信息的比价网站BE告上了法庭，eBay声称自己已经将哪些信息不能抓取写进了robots协议中，但BE违反了这一协议。但BE认为eBay上的内容属于用户集体贡献而不归用户所有，爬虫协议不能用作法律参考。最后经过业内反复讨论和法庭上的几轮唇枪舌战，最终以eBay胜诉告终，也开了用爬虫robots协议作为主要参考的先河。</li>
<li>最后，可以通过网站域名 + /robots.txt的形式访问该网站的协议详情，例如：<a target="_blank" rel="noopener" href="http://www.taobao.com/robots.txt">www.taobao.com/robots.txt</a></li>
</ul>
<hr>
</li>
<li><h2 id="什么是http协议"><a href="#什么是http协议" class="headerlink" title="什么是http协议?"></a>什么是http协议?</h2><ul>
<li><p><strong>官方概念：</strong>HTTP协议是Hyper Text Transfer Protocol（超文本传输协议）的缩写,是用于从万维网（WWW:World Wide Web ）服务器传输超文本到本地浏览器的传送协议。（虽然童鞋们将这条概念都看烂了，但是也没办法，毕竟这就是HTTP的权威官方的概念解释，要想彻底理解，请客观目移下侧……）</p>
</li>
<li><p><strong>白话概念：</strong>HTTP协议就是服务器（Server）和客户端（Client）之间进行数据交互（相互传输数据）的一种形式。我们可以将Server和Client进行拟人化，那么该协议就是Server和Client这两兄弟间指定的一种交互沟通方式。大家都看过智取威虎山中杨子荣和土匪们之间说的黑话吧：</p>
<figure class="highlight text"><table><tr><td class="code"><pre><span class="line">- 土匪：蘑菇，你哪路？什么价？（什么人？到哪里去？）</span><br><span class="line">      　　　　　　- 杨子荣：哈！想啥来啥，想吃奶来了妈妈，想娘家的人，孩子他舅舅来了。（找同行）</span><br><span class="line">      　　　　　　- 杨子荣：拜见三爷！</span><br><span class="line">      　　　　　　- 土匪：天王盖地虎！（你好大的胆！敢来气你的祖宗？）</span><br><span class="line">      　　　　　　- 杨子荣：宝塔镇河妖！（要是那样，叫我从山上摔死，掉河里淹死。）</span><br><span class="line">      　　　　　　- 土匪：野鸡闷头钻，哪能上天王山！（你不是正牌的。）</span><br><span class="line">      　　　　　　- 杨子荣：地上有的是米，喂呀，有根底！（老子是正牌的，老牌的。）</span><br><span class="line">      　　　　　　- 土匪：拜见过阿妈啦？（你从小拜谁为师？）</span><br><span class="line">      　　　　　　- 杨子荣：他房上没瓦，非否非，否非否！（不到正堂不能说。）</span><br><span class="line">      　　　　　　- 土匪：嘛哈嘛哈？（以前独干吗？）</span><br><span class="line">      　　　　　　- 杨子荣：正晌午说话，谁还没有家？（许大马棒山上。）</span><br><span class="line">      　　　　　　- 土匪：好叭哒！（内行，是把老手）</span><br><span class="line">      　　　　　　- 杨子荣：天下大耷拉！（不吹牛，闯过大队头。）</span><br><span class="line">      　　　　　　- 座山雕：脸红什么？</span><br><span class="line">      　　　　　　- 杨子荣：精神焕发！</span><br><span class="line">      　　　　　　- 座山雕：怎么又黄了？</span><br><span class="line">      　　　　　　- 杨子荣：防冷，涂的蜡！</span><br><span class="line">      　　　　　　- 座山雕：晒哒晒哒。（谁指点你来的？）</span><br><span class="line">      　　　　　　- 杨子荣：一座玲珑塔，面向青寨背靠沙！（是个道人。）</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong><em>是不是看到这里，有得童鞋终于知道了传说中的‘天王盖地虎’是真正含义了吧。此黑话其实就是杨子荣和土匪之间进行交互沟通的方式（协议）。</em></strong></p>
</li>
</ul>
<hr>
</li>
<li><h2 id="HTTP工作原理"><a href="#HTTP工作原理" class="headerlink" title="HTTP工作原理:"></a>HTTP工作原理:</h2><ul>
<li><p>HTTP协议工作于客户端-服务端架构为上。浏览器作为HTTP客户端通过URL向HTTP服务端即WEB服务器发送所有请求。Web服务器根据接收到的请求后，向客户端发送响应信息。</p>
<p><img src= "/img/loading.gif" data-lazy-src="https://book.apeland.cn/media/images/2019/04/10/snip20190410_8.png" alt="img"></p>
</li>
<li><h4 id="常见的请求头信息"><a href="#常见的请求头信息" class="headerlink" title="常见的请求头信息:"></a>常见的请求头信息:</h4><figure class="highlight python"><table><tr><td class="code"><pre><span class="line">accept:浏览器通过这个头告诉服务器，它所支持的数据类型</span><br><span class="line">      　　　　　　　　Accept-Charset: 浏览器通过这个头告诉服务器，它支持哪种字符集</span><br><span class="line">      　　　　　　　　Accept-Encoding：浏览器通过这个头告诉服务器，支持的压缩格式</span><br><span class="line">      　　　　　　　　Accept-Language：浏览器通过这个头告诉服务器，它的语言环境</span><br><span class="line">      　　　　　　　　Host：浏览器通过这个头告诉服务器，想访问哪台主机</span><br><span class="line">      　　　　　　　　If-Modified-Since: 浏览器通过这个头告诉服务器，缓存数据的时间</span><br><span class="line">      　　　　　　　　Referer：浏览器通过这个头告诉服务器，客户机是哪个页面来的 防盗链</span><br><span class="line">      　　　　　　　　Connection：浏览器通过这个头告诉服务器，请求完后是断开链接还是何持链接</span><br><span class="line">      　　　　　　　　X-Requested-With: XMLHttpRequest 代表通过ajax方式进行访问</span><br><span class="line">      　　　　　　　　User-Agent：请求载体的身份标识</span><br></pre></td></tr></table></figure>
</li>
<li><h4 id="常见的响应头信息"><a href="#常见的响应头信息" class="headerlink" title="常见的响应头信息:"></a>常见的响应头信息:</h4><figure class="highlight python"><table><tr><td class="code"><pre><span class="line">Location: 服务器通过这个头，来告诉浏览器跳到哪里</span><br><span class="line">      　　　　　　　　Server：服务器通过这个头，告诉浏览器服务器的型号</span><br><span class="line">      　　　　　　　　Content-Encoding：服务器通过这个头，告诉浏览器，数据的压缩格式</span><br><span class="line">      　　　　　　　　Content-Length: 服务器通过这个头，告诉浏览器回送数据的长度</span><br><span class="line">      　　　　　　　　Content-Language: 服务器通过这个头，告诉浏览器语言环境</span><br><span class="line">      　　　　　　　　Content-Type：服务器通过这个头，告诉浏览器回送数据的类型</span><br><span class="line">      　　　　　　　　Refresh：服务器通过这个头，告诉浏览器定时刷新</span><br><span class="line">      　　　　　　　　Content-Disposition: 服务器通过这个头，告诉浏览器以下载方式打数据</span><br><span class="line">      　　　　　　　　ransfer-Encoding：服务器通过这个头，告诉浏览器数据是以分块方式回送的</span><br><span class="line">      　　　　　　　　Expires: <span class="number">-1</span> 控制浏览器不要缓存</span><br><span class="line">      　　　　　　　　Cache-Control: no-cache </span><br><span class="line">      　　　　　　　　Pragma: no-cache</span><br></pre></td></tr></table></figure>

</li>
</ul>
<hr>
</li>
<li><h2 id="https协议"><a href="#https协议" class="headerlink" title="https协议:"></a>https协议:</h2><ul>
<li><p>HTTPS (Secure Hypertext Transfer Protocol)<strong>安全超文本传输协议</strong>，HTTPS是在HTTP上建立SSL加密层，并对传输数据进行加密，是HTTP协议的安全版。</p>
<p><img src= "/img/loading.gif" data-lazy-src="https://book.apeland.cn/media/images/2019/04/10/snip20190410_3.png" alt="img"></p>
</li>
</ul>
<hr>
</li>
<li><h2 id="https加密算法"><a href="#https加密算法" class="headerlink" title="https加密算法:"></a>https加密算法:</h2><ul>
<li><p><strong>对称秘钥加密：</strong>客户端向服务器发送一条信息，首先客户端会采用已知的算法对信息进行加密，比如MD5或者Base64加密，接收端对加密的信息进行解密的时候需要用到密钥，中间会传递密钥，（加密和解密的密钥是同一个），密钥在传输中间是被加密的。这种方式看起来安全，但是仍有潜在的危险，一旦被窃听，或者信息被挟持，就有可能破解密钥，而破解其中的信息。因此“共享密钥加密”这种方式存在安全隐患。<img src= "/img/loading.gif" data-lazy-src="https://book.apeland.cn/media/images/2019/04/10/snip20190410_5.png" alt="img"></p>
</li>
<li><p><strong>非对称秘钥加密：</strong>“非对称加密”使用的时候有两把锁，一把叫做“私有密钥”，一把是“公开密钥”，使用非对象加密的加密方式的时候，服务器首先告诉客户端按照自己给定的公开密钥进行加密处理，客户端按照公开密钥加密以后，服务器接受到信息再通过自己的私有密钥进行解密，这样做的好处就是解密的钥匙根本就不会进行传输，因此也就避免了被挟持的风险。就算公开密钥被窃听者拿到了，它也很难进行解密，因为解密过程是对离散对数求值，这可不是轻而易举就能做到的事。以下是非对称加密的原理图：</p>
<p><img src= "/img/loading.gif" data-lazy-src="https://book.apeland.cn/media/images/2019/04/10/snip20190410_6.png"></p>
<ul>
<li>但是非对称秘钥加密技术也存在如下缺点：<ol>
<li>第一个是：如何保证接收端向发送端发出公开秘钥的时候，发送端确保收到的是预先要发送的，而不会被挟持。只要是发送密钥，就有可能有被挟持的风险。</li>
<li>第二个是：非对称加密的方式效率比较低，它处理起来更为复杂，通信过程中使用就有一定的效率问题而影响通信速度</li>
</ol>
</li>
</ul>
</li>
<li><p><strong>证书秘钥加密：</strong>在上面我们讲了非对称加密的缺点，其中第一个就是公钥很可能存在被挟持的情况，无法保证客户端收到的公开密钥就是服务器发行的公开密钥。此时就引出了公开密钥证书机制。数字证书认证机构是客户端与服务器都可信赖的第三方机构。证书的具体传播过程如下：</p>
<ol>
<li>服务器的开发者携带公开密钥，向数字证书认证机构提出公开密钥的申请，数字证书认证机构在认清申请者的身份，审核通过以后，会对开发者申请的公开密钥做数字签名，然后分配这个已签名的公开密钥，并将密钥放在证书里面，绑定在一起</li>
<li>服务器将这份数字证书发送给客户端，因为客户端也认可证书机构，客户端可以通过数字证书中的数字签名来验证公钥的真伪，来确保服务器传过来的公开密钥是真实的。一般情况下，证书的数字签名是很难被伪造的，这取决于认证机构的公信力。一旦确认信息无误之后，客户端就会通过公钥对报文进行加密发送，服务器接收到以后用自己的私钥进行解密。</li>
</ol>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<pre><code>- ![img](https://book.apeland.cn/media/images/2019/04/10/snip20190410_7.png)</code></pre>
<hr>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">六根清静</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://liugenqingjing2.coding.me/2020/12/02/Python%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%82%B9-%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80%E7%AE%80%E4%BB%8B/">https://liugenqingjing2.coding.me/2020/12/02/Python基础知识点-爬虫基础简介/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://liugenqingjing2.coding.me" target="_blank">小何blog (记录美好)</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Python/">Python</a><a class="post-meta__tags" href="/tags/%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E2%9C%8D%EF%B8%8F/">基础知识✍️</a></div><div class="post_share"><div class="social-share" data-image="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201202/5vjB9ckhmw@0.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏<div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="http://qew58kkb2.hn-bkt.clouddn.com/wechat%20%20%281%29.png" target="_blank"><img class="post-qr-code-img" data-lazy-src="http://qew58kkb2.hn-bkt.clouddn.com/wechat%20%20%281%29.png" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li></ul></div></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/12/05/Python%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%82%B9-%E7%88%AC%E8%99%AB%E4%B9%8Brequests%E6%A8%A1%E5%9D%97/"><img class="prev-cover" data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201205/IGfP9VUx2RxJ.jpg" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Python基础知识点(爬虫之requests模块)</div></div></a></div><div class="next-post pull-right"><a href="/2020/11/30/Python%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%82%B9-%E5%85%AB-%E9%94%99%E8%AF%AF%E4%B8%8E%E5%BC%82%E5%B8%B8/"><img class="next-cover" data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201130/3*T4@zmMiVWJ.jpg" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Python基础知识点(八.错误与异常)</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2020/11/22/Python基础知识点-一/" title="Python基础知识点(一)"><img class="cover" data-lazy-src="http://kp.027cgb.cn/632500/v2-20ea5bb113cc6d2e6f652c55d58d8873_r.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-22</div><div class="title">Python基础知识点(一)</div></div></a></div><div><a href="/2020/11/25/Python基础知识点-三/" title="Python基础知识点(三)"><img class="cover" data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201125/JDyfB^SVIBky.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-25</div><div class="title">Python基础知识点(三)</div></div></a></div><div><a href="/2020/11/30/Python基础知识点-七/" title="Python基础知识点(七.文件操作)"><img class="cover" data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201130/*pMaH7lvICSp.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-30</div><div class="title">Python基础知识点(七.文件操作)</div></div></a></div><div><a href="/2020/11/24/Python基础知识点-二/" title="Python基础知识点(二)"><img class="cover" data-lazy-src="http://jo.027cgb.cn/632500/v2-b340f24f677d70a4f10e52aee9c1a09c_r.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-24</div><div class="title">Python基础知识点(二)</div></div></a></div><div><a href="/2020/11/30/Python基础知识点-八-错误与异常/" title="Python基础知识点(八.错误与异常)"><img class="cover" data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20201130/3*T4@zmMiVWJ.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-30</div><div class="title">Python基础知识点(八.错误与异常)</div></div></a></div><div><a href="/2020/11/27/Python基础知识点-五/" title="Python基础知识点(五)"><img class="cover" data-lazy-src="http://jo.027cgb.cn/632500/v2-8ec31945a8573cd2da251264e88f3843_r.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-11-27</div><div class="title">Python基础知识点(五)</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" data-lazy-src="http://01.027cgb.com/632500/1576904533264.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">六根清静</div><div class="author-info__description">记录美好，记录生活，记录学习</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">138</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">63</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/he_chaoming/dashboard/projects?scope=public&amp;&amp;sort="><i class="fab fa-gofore"></i><span>My Gitee</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/he1213114428" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:484695754@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="tencent://message/?uin=484695754" target="_blank" title="QQ"><i class="fab fa-qq"></i></a></div></div></div><div class="card-widget card-recent-post"><div id="gamenews"><div class="card-content"><div class="item-headline"><i class="fas fa-cube"></i><span>ROLL资讯</span><i class="fas fa-retweet" @click="changetype(current)" style="float:right;margin-top:8px"></i></div><div class="newsbar"><span v-for="(type, index) in listtype" v-on:click="addClass(index)" v-bind:class="{ listtypeon:index==current}">{{type}}</span></div><div class="aside-list"><div class="aside-list-item" v-for="(news,index) in newsvue"><a class="thumbnail" href="javascript:void(0)" @click="getnewsdata(index)" :title="news.title"><img class="loaded" onerror="this.onerror=null;this.src='/img/404.jpg'" data-ll-status="loaded" :src="news.imgList[0]"/></a><div class="content"><a class="title" href="javascript:void(0)" @click="getnewsdata(index)" :title="news.title">{{news.title}}</a><time>{{news.postTime}}</time></div></div></div></div><div id="newsmodal"><button class="modalclose" @click="hidemodle()">关闭</button><h2>{{newpostvue.title}} </h2><h4>{{newpostvue.ptime}} &nbsp;&nbsp; {{newpostvue.source}}</h4><div v-html="newpostvue.content"></div></div></div></div><div class="card-widget card-shuo"><div class="card-content" style="height:auto;min-height:280px;"><div class="item-headline"><i class="fas fa-comments"></i><span>&#x8BF4;&#x8BF4</span><a id="shuovisualchange" style="cursor:pointer;float:right" onclick="shuovisualchange()">编辑</a></div><div id="artitalk_main" style="width:100%;height:100%;padding:10px"></div></div></div><div class="sticky_layout"></div><div class="card-widget card-history"><div class="card-content"><div class="item-headline"><i class="fas fa-paw fa-spin"></i><span>那年今日</span></div><div id="history-news" style="height: 100px;overflow: hidden;"><div id="history-card"></div></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">大学生一枚，软件工程，想做全栈攻城狮，哈哈，有兴趣可以加 QQ:484695754 (也可以点上面的logo)，一起交流学习</div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="card-content"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Python%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E7%82%B9-%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80%E7%AE%80%E4%BB%8B-%EF%BC%9A"><span class="toc-number">1.</span> <span class="toc-text">Python基础知识点(爬虫基础简介)：</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF%E7%88%AC%E8%99%AB%EF%BC%9F"><span class="toc-number">1.1.</span> <span class="toc-text">什么是爬虫？</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%88%AC%E8%99%AB%E7%9A%84%E4%BB%B7%E5%80%BC%EF%BC%9A"><span class="toc-number">1.2.</span> <span class="toc-text">爬虫的价值：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%88%AC%E8%99%AB%E7%A9%B6%E7%AB%9F%E6%98%AF%E5%90%88%E6%B3%95%E8%BF%98%E6%98%AF%E8%BF%9D%E6%B3%95%E7%9A%84%EF%BC%9F"><span class="toc-number">1.3.</span> <span class="toc-text">爬虫究竟是合法还是违法的？</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%88%AC%E8%99%AB%E6%89%80%E5%B8%A6%E6%9D%A5%E9%A3%8E%E9%99%A9%E4%B8%BB%E8%A6%81%E4%BD%93%E7%8E%B0%E5%9C%A8%E4%BB%A5%E4%B8%8B2%E4%B8%AA%E6%96%B9%E9%9D%A2%EF%BC%9A"><span class="toc-number">1.4.</span> <span class="toc-text">爬虫所带来风险主要体现在以下2个方面：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%82%A3%E4%B9%88%E4%BD%9C%E4%B8%BA%E7%88%AC%E8%99%AB%E5%BC%80%E5%8F%91%E8%80%85%EF%BC%8C%E5%A6%82%E4%BD%95%E5%9C%A8%E4%BD%BF%E7%94%A8%E7%88%AC%E8%99%AB%E6%97%B6%E9%81%BF%E5%85%8D%E8%BF%9B%E5%B1%80%E5%AD%90%E7%9A%84%E5%8E%84%E8%BF%90%E5%91%A2%EF%BC%9F"><span class="toc-number">1.5.</span> <span class="toc-text">那么作为爬虫开发者，如何在使用爬虫时避免进局子的厄运呢？</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%88%AC%E8%99%AB%E5%88%9D%E8%AF%86%E6%B7%B1%E5%85%A5"><span class="toc-number">2.</span> <span class="toc-text">爬虫初识深入:</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%93%AA%E4%BA%9B%E8%AF%AD%E8%A8%80%E5%8F%AF%E4%BB%A5%E5%AE%9E%E7%8E%B0%E7%88%AC%E8%99%AB%EF%BC%9A"><span class="toc-number">2.1.</span> <span class="toc-text">哪些语言可以实现爬虫：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%88%AC%E8%99%AB%E7%9A%84%E5%88%86%E7%B1%BB"><span class="toc-number">2.2.</span> <span class="toc-text">爬虫的分类:</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%88%AC%E8%99%AB%E7%9A%84%E7%9F%9B%E4%B8%8E%E7%9B%BE"><span class="toc-number">2.3.</span> <span class="toc-text">爬虫的矛与盾:</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%8D%E7%88%AC%E6%9C%BA%E5%88%B6%EF%BC%9A"><span class="toc-number">2.4.</span> <span class="toc-text">反爬机制：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%8D%E5%8F%8D%E7%88%AC%E7%AD%96%E7%95%A5%EF%BC%9A"><span class="toc-number">2.5.</span> <span class="toc-text">反反爬策略：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#robots%E5%8D%8F%E8%AE%AE%EF%BC%9A"><span class="toc-number">2.6.</span> <span class="toc-text">robots协议：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BB%80%E4%B9%88%E6%98%AFhttp%E5%8D%8F%E8%AE%AE"><span class="toc-number">2.7.</span> <span class="toc-text">什么是http协议?</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#HTTP%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86"><span class="toc-number">2.8.</span> <span class="toc-text">HTTP工作原理:</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%B8%B8%E8%A7%81%E7%9A%84%E8%AF%B7%E6%B1%82%E5%A4%B4%E4%BF%A1%E6%81%AF"><span class="toc-number">2.8.0.1.</span> <span class="toc-text">常见的请求头信息:</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%B8%B8%E8%A7%81%E7%9A%84%E5%93%8D%E5%BA%94%E5%A4%B4%E4%BF%A1%E6%81%AF"><span class="toc-number">2.8.0.2.</span> <span class="toc-text">常见的响应头信息:</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#https%E5%8D%8F%E8%AE%AE"><span class="toc-number">2.9.</span> <span class="toc-text">https协议:</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#https%E5%8A%A0%E5%AF%86%E7%AE%97%E6%B3%95"><span class="toc-number">2.10.</span> <span class="toc-text">https加密算法:</span></a></li></ol></li></ol></div></div></div><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/03/21/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81%E4%B8%89-%E8%B7%A8%E5%9F%9F%E4%BB%8B%E7%BB%8D%E5%92%8CJSONP%E4%BB%8B%E7%BB%8D/" title="Node.js学习(二十三.跨域介绍和JSONP介绍)"><img data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20210321/qWPEashJOuNK.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Node.js学习(二十三.跨域介绍和JSONP介绍)"/></a><div class="content"><a class="title" href="/2021/03/21/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81%E4%B8%89-%E8%B7%A8%E5%9F%9F%E4%BB%8B%E7%BB%8D%E5%92%8CJSONP%E4%BB%8B%E7%BB%8D/" title="Node.js学习(二十三.跨域介绍和JSONP介绍)">Node.js学习(二十三.跨域介绍和JSONP介绍)</a><time datetime="2021-03-21T13:40:58.000Z" title="发表于 2021-03-21 21:40:58">2021-03-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/20/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81%E4%BA%8C-Node-js%E9%A1%B9%E7%9B%AE%E6%B5%81%E7%A8%8B-%E4%B8%8B/" title="Node.js学习(二十二.Node.js项目流程(下))"><img data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20210320/CvAoe6kC5*f2.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Node.js学习(二十二.Node.js项目流程(下))"/></a><div class="content"><a class="title" href="/2021/03/20/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81%E4%BA%8C-Node-js%E9%A1%B9%E7%9B%AE%E6%B5%81%E7%A8%8B-%E4%B8%8B/" title="Node.js学习(二十二.Node.js项目流程(下))">Node.js学习(二十二.Node.js项目流程(下))</a><time datetime="2021-03-20T14:33:29.000Z" title="发表于 2021-03-20 22:33:29">2021-03-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/15/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81%E4%B8%80-Node-js%E9%A1%B9%E7%9B%AE%E6%B5%81%E7%A8%8B-%E4%B8%AD/" title="Node.js学习(二十一.Node.js项目流程(中))"><img data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20210320/gSrAfCznw@^F.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Node.js学习(二十一.Node.js项目流程(中))"/></a><div class="content"><a class="title" href="/2021/03/15/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81%E4%B8%80-Node-js%E9%A1%B9%E7%9B%AE%E6%B5%81%E7%A8%8B-%E4%B8%AD/" title="Node.js学习(二十一.Node.js项目流程(中))">Node.js学习(二十一.Node.js项目流程(中))</a><time datetime="2021-03-15T04:35:12.000Z" title="发表于 2021-03-15 12:35:12">2021-03-15</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/03/14/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81-Node-js%E9%A1%B9%E7%9B%AE%E6%B5%81%E7%A8%8B(%E4%B8%8A)/" title="Node.js学习(二十.Node.js项目流程(上))"><img data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20210320/UMp@B^akHmf8.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Node.js学习(二十.Node.js项目流程(上))"/></a><div class="content"><a class="title" href="/2021/03/14/Node-js%E5%AD%A6%E4%B9%A0-%E4%BA%8C%E5%8D%81-Node-js%E9%A1%B9%E7%9B%AE%E6%B5%81%E7%A8%8B(%E4%B8%8A)/" title="Node.js学习(二十.Node.js项目流程(上))">Node.js学习(二十.Node.js项目流程(上))</a><time datetime="2021-03-14T14:36:58.000Z" title="发表于 2021-03-14 22:36:58">2021-03-14</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/02/27/Node-js%E5%AD%A6%E4%B9%A0-%E5%8D%81%E4%B9%9D-%E5%B0%81%E8%A3%85%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93%E5%92%8CCSRF/" title="Node.js学习(十九.封装操作数据库和CSRF)"><img data-lazy-src="https://gitee.com/he_chaoming/blog_tuchuang/raw/master/20210227/EcgLTE4WPOp^.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Node.js学习(十九.封装操作数据库和CSRF)"/></a><div class="content"><a class="title" href="/2021/02/27/Node-js%E5%AD%A6%E4%B9%A0-%E5%8D%81%E4%B9%9D-%E5%B0%81%E8%A3%85%E6%93%8D%E4%BD%9C%E6%95%B0%E6%8D%AE%E5%BA%93%E5%92%8CCSRF/" title="Node.js学习(十九.封装操作数据库和CSRF)">Node.js学习(十九.封装操作数据库和CSRF)</a><time datetime="2021-02-27T13:20:18.000Z" title="发表于 2021-02-27 21:20:18">2021-02-27</time></div></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By 六根清静</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi,  welcome  to  my  <a  href="">blog</a>!</div><div class="icp"><a><img class="icp-icon" src="/img/icp.png" alt="ICP"/><span>豫ICP备2020025430号</span></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="chat_btn" type="button" title="rightside.chat_btn"><i class="fas fa-sms"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"><div id="local-hits"></div><div id="local-stats"><div class="local-search-stats__hr" id="hr"><span>由</span> <a target="_blank" rel="noopener" href="https://github.com/wzpan/hexo-generator-search" style="color:#49B1F5;">hexo-generator-search</a>
 <span>提供支持</span></div></div></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module" defer></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script async="async">var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> {preloader.endLoading()})
setTimeout(function(){preloader.endLoading();}, 50000);</script><div class="js-pjax"><script>function loadValine () {
  function initValine () {
    let initData = {
      el: '#vcomment',
      appId: 'kW2ft895T235y7DxmyJmXX5X-MdYXbMMI',
      appKey: 'v0zBPCAdwiJ0xg4s4eSfusLD',
      placeholder: '建议使用QQ邮箱，评论头像采用QQ头像',
      avatar: 'monsterid',
      meta: 'nick,mail,link'.split(','),
      pageSize: '10',
      lang: 'zh-CN',
      recordIP: false,
      serverURLs: 'https://???????.api.lncldglobal.com',
      emojiCDN: '',
      emojiMaps: "",
      enableQQ: true,
      path: window.location.pathname,
      master: '1f76478c4ec918ffc6d50de6b68db531'.split(','),
      friends: '5c?????bfe6rfc72a????e268ad3819c,7c?????bfe65fc02a????e2????3919c'.split(','),
      tagMeta: '博主,小伙伴,访客'.split(',')
    }

    if (true) { 
      initData.requiredFields= ('nick,mail'.split(','))
    }
    
    if (false) {
      const otherData = false
      initData = Object.assign({}, initData, otherData)
    }
    
    const valine = new Valine(initData)
  }

  if (typeof Valine === 'function') initValine() 
  else $.getScript('https://cdn.jsdelivr.net/gh/HCLonely/Valine@latest/dist/Valine.min.js', initValine)
}

if ('Valine' === 'Valine' || !true) {
  if (true) btf.loadComment(document.querySelector('#vcomment'),loadValine)
  else setTimeout(() => loadValine(), 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script src='https://cdn.jsdelivr.net/npm/artitalk'></script><script> $(".category-list-count").prepend("<i class=\"fas fa-book\"></i>");</script><script src="/js/list.js"></script><script src="/js/gitcalendar.js"></script><script src="/js/calendar.js"></script><script src="/js/xkTool.js"></script><script src="/js/pjax.js"></script><script src="/magnet/js/vue.min.js"></script><script src="/magnet/js/catalogMagnet.js"></script><script src="/js/airvisualapi.js"></script><script src="/js/history.js"></script><script src="/js/historyroll.js"></script><script src="/js/change.js"></script><script type="text/javascript" src="https://www.airvisual.com/scripts/widget_v2.0.js"></script><script> setTimeout(function(){$('.monoline').eq(0).html($(".monoline strong").eq(0).text().replace('°','℃'));},5000);</script><script src="https://cdn.jsdelivr.net/gh/sviptzk/HexoStaticFile@latest/Hexo/js/mouse_snow.min.js"></script><script src="/js/myBg.js"></script><script src="/js/shuo.js"></script><script src="/js/artitalkkey.js"></script><script src="/news/js/keys.js"></script><script src="/news/js/news.js"></script><script src="https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@latest/butterfly/js/pool.min.js"><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/stars/stars.js"></script><script src="https://cdn1.lncld.net/static/js/3.5.0/av-min.js"></script><script src="/zan/zan.js"></script><div class="aplayer no-destroy" data-id="2916766519" data-server="netease" data-type="playlist" data-fixed="true" data-mini="true" data-listFolded="false" data-order="random" data-preload="none" data-autoplay="false" muted></div><script src="/swiper/swiper.min.js"></script><script src="/swiper/swiperindex.js"></script><script async src="//at.alicdn.com/t/font_2264842_3izu8i5eoc2.js"></script><canvas class="fireworks" mobile="false"></canvas><script src="/js/third-party/fireworks.js"></script><script src="/js/third-party/activate-power-mode.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script>(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/6fdec148.js","daovoice")
</script><script>var isChatBtn = true
daovoice('init', {
  app_id: '6fdec148',},{
  launcher: { 
     disableLauncherIcon: isChatBtn // 悬浮 ICON 是否显示
  },
});
daovoice('update');

if (isChatBtn) {
  var chatBtnFn = () => {
    var chatBtn = document.getElementById("chat_btn")
    chatBtn.addEventListener("click", function(){
      daovoice('show')
    });
  }
  chatBtnFn()
} else {
  if (true) {
    function chatBtnHide () {
      daovoice('update', {},{
        launcher: { 
        disableLauncherIcon: true // 悬浮 ICON 是否显示
        },
      });
    }
    function chatBtnShow () {
      daovoice('update', {},{
        launcher: { 
        disableLauncherIcon: false // 悬浮 ICON 是否显示
        },
      });
    }
  }
}</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js"></script></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618,"jsonPath":"/live2dw/assets/unitychan.model.json"},"display":{"superSample":2,"width":150,"height":300,"position":"right","hOffset":0,"vOffset":-20},"mobile":{"show":true,"scale":0.6},"react":{"opacityDefault":0.7,"opacityOnHover":0.8},"log":false});</script></body></html>